<h5><?php echo t('page', 'Edit User Options'); ?></h5>

<div class="row-fluid">	
	<div class="span12 individual_option_form_info hide" id="individual_option_success_info">
		<div class="alert alter-block alert-success">
<!--				<button type="button" class="close" data-dismiss="alert">&times;</button>-->
			<h4>Success</h4>
			<div class="content">User has been saved!</div>
		</div>
	</div>
</div>

<div class="row-fluid">	
	<div class="span12 individual_option_form_info hide" id="individual_option_error_info">
		<div class="alert alter-block alert-error">
<!--				<button type="button" class="close" data-dismiss="alert">&times;</button>-->
			<h4>Error</h4>
			<div class="content"></div>
		</div>
	</div>
</div>
		
<?php $form = $this->beginWidget('CActiveForm', array(
	'id' => 'individual-option-form',
	'enableClientValidation' => true,
	'clientOptions' => array(
		'validateOnSubmit' => true,
	),
)); ?>
	<?php echo $form->hiddenField($userOptionForm, 'id_user'); ?>
	
	<div class="row-fluid">
		<?php echo $form->label($userOptionForm, 'wiki_help'); ?>
		<?php echo $form->dropDownList($userOptionForm, 'wiki_help', $userOptionForm->wikiDatasource(), array('placeholder' => $userOptionForm->getFieldLabel('wiki_help'), 'class' => 'fields')); ?>
		<span class="help-inline">Turn support links on all pages on or off.</span>
	</div>
		
	<div class="row-fluid">
		<?php echo $form->label($userOptionForm, 'language'); ?>
		<?php echo $form->dropDownList($userOptionForm, 'language', $userOptionForm->languageDatasource(), array('placeholder' => $userOptionForm->getFieldLabel('language'), 'class' => 'fields')); ?>
		<span class="help-inline">Change to your desired language.</span>
	</div>
		
	<div class="row-fluid">
		<?php echo $form->label($userOptionForm, 'pagination'); ?>
		<?php echo $form->dropDownList($userOptionForm, 'pagination', $userOptionForm->paginationDatasource(), array('placeholder' => $userOptionForm->getFieldLabel('pagination'), 'class' => 'fields')); ?>
		<span class="help-inline">Amount of items to return in lists on each page.</span>
	</div>
	
	<div class="row-fluid">
		<?php echo $form->label($userOptionForm, 'restrict_ips'); ?>
		<label class="checkbox">
			<?php echo $form->checkbox($userOptionForm, 'allow_reset_restrict_ip_byemail'); ?> Allow reset IP restriction by email.
		</label>
		<?php echo $form->textArea($userOptionForm, 'restrict_ips', array('rows' => 3, 'class' => 'fields')); ?>
		<span class="help-inline">List one IP per line. (Be sure you have a static IP.)</span>
	</div>
	
	<div class="row-fluid buttons">
		<?php echo CHtml::ajaxSubmitButton(
			t('buttons', 'Update User Account'), 
			app()->createUrl('user/individualoption'),
			array(
				'type' => 'post',
				'beforeSend' => 'function(){
					$("#individual_option_submit").button("loading");
				}',
				'success' => 'function(ret){
					$(".individual_option_form_info").hide();
					$("#individual_option_submit").button("reset");
					if(ret["result"]){
						$("#individual_option_success_info").blink();
					}else{
						$("#individual_option_error_info").blink({
							"beforeCall": function(){
								$("#individual_option_error_info .content").html("");
								$.each(ret["errors"], function(attrName, error){
									$(error).each(function(k, e){
										var p = $("<p />").addClass("text-error").append(attrName+": "+e);
										$("#individual_option_error_info .content").append(p);
									});
								});
							}
						});
					}
				}',
				'dataType' => 'json'
			),
			array(
				'id' => 'individual_option_submit',
				'type' => 'button', 
				'class' => 'btn btn-small btn-primary',
				'data-loading-text' => 'Saving'
			)
		); ?>
	</div>
<?php $this->endWidget(); ?>